import VueRouter from 'vue-router';
import Vue from 'vue';



Vue.use(VueRouter)
import Home from '@/pages/Home/Home.vue'
import NotFound from '@/pages/NotFound/NotFound.vue'
import PreviewFile from '@/pages/View/PreviewFile.vue'

const routers = [

    {
        path: '/',

        redirect: {
            path: '/nopages',
          
        },
    },
    {
        path: '/edit/:kfid',
        props: true,
        name: 'edit',
        component: Home,
    },
    {
        path: '/nopages',
        name: 'nopages',
        component: NotFound,
    },
    {
        path: '/view/:kfid',
        component: PreviewFile,
        // redirect: '/view/previewFile',
        name: '',
        children: [
            {
                component: PreviewFile,
                path: 'previewFile',
                // path: '/previewFile',
                name: 'previewFile',
            }
        ]
    },
]
const router = new VueRouter({
    mode: 'hash',
    routes: routers,
})
export default router